import React from "react";
import eventBus from "./eventBus";
export  default function ComponentB() {
    const [message, setMessage] = React.useState('')
    eventBus.on('myEvent', (data) => {
        setMessage(data)
    })
    return (
        <div>
            <h1>Component B</h1>
            <div>这串信息是:{message}</div>
        </div>
    )
}
